//
// smtp.h
// libprotea
// Tools Library for the Protea Project / Simple Mail Transfer Protocol (SMTP) used in server-side reporting
// Copyright (C) 2003, 2004, 2005 eXegeSys, Inc.
// Copyright (C) 2008 Bruce A. James
//
// This program is part of the Protea Project.
//
// The Protea Project is free software; you can redistribute it and/or modify it 
// under the terms of the GNU General Public License as published by the 
// Free Software Foundation, either version 3 of the License, or (at your 
// option) any later version.
//
// The Protea Project is distributed in the hope that it will be useful, but 
// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 
// for more details.
// 
// You should have received a copy of the GNU General Public License along 
// with this program.  If not, see <http://www.gnu.org/licenses/>.
// 
// Please send correspondence to:
// 
// theproteaproject@gmail.com
//

#ifndef __PROTEA_SMTP_H__
#define __PROTEA_SMTP_H__

class XCSMTPException {
public:
	XCSMTPException( int number );
	void GetDescription( char* data );

	int exception_number;
};


class XCMessageRept {
public:
	char* to;
	char* nicename;
	XCMessageRept* next;
};

class XCAttachment {
public:
	char* file;
	XCAttachment* next;
};

class XCMessage {
public:
	XCMessage();
	~XCMessage();

	void SetSubject( const char* subject );
	void SetFrom( const char* from );
	void SetData( const char* data );
	void AddRecp( const char* user, const char* nicename = NULL );
	void AddAttachment( const char* filename );
	void Send( const char* host = NULL );

protected:
	XCMessageRept* rept;
	XCAttachment* attachments;

	int GetResponse( XCSocketTransport* socket );
	int last_response;

	char* from;
	char* nicename;
	char* subject;
	char* msg_data;
};

#endif
